/*
 * FNIHour12TokenFormatter
 *  
 * Copyright (C) 2008 - 2009 Antti Leppä / Foyt
 * http://www.foyt.fi
 * 
 * License: 
 * 
 * Licensed under GNU Lesser General Public License Version 2.1 or later (the "LGPL") 
 * http://www.gnu.org/licenses/lgpl.html
 */
fni.locale.dateformat.FNIHour12TokenFormatter = Class.create(fni.locale.dateformat.FNITokenFormatter, 
  /** @lends fni.locale.dateformat.FNIHour12TokenFormatter# */ 
  {
  /**
   * Class constructor
   * @class Implements 'h' token formatter 
   * @extends fni.locale.dateformat.FNITokenFormatter
   * @constructs
   * @param $super super class 
   */
  initialize: function ($super) {
    $super();
  },
  getToken: function () {
    return 'h';
  },
  format: function (date) {
    return ((date.getHours() + 11) % 12) + 1;
  }
});

fni.locale.dateformat.FNITokenFormatterVault.register(new fni.locale.dateformat.FNIHour12TokenFormatter());